<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<link rel="stylesheet" href="${initParam.root}css/table.css" type="text/css">

<c:choose>
<c:when test="${requestScope.dealList=='Empty'}">
<h2>등록한 상품이 없습니다.</h2>
</c:when>
<c:otherwise>

<div align="center">
<h2>아기돼지삼도니네 상품리스트</h2>
</div>
<table  border="1" class="dealListTable"  style="margin: 0 auto ; width: 80%" >
	<c:forEach var="list" items="${requestScope.dealList}" varStatus="status">
         <c:if test="${status.index%3==0 }">
         <tr>
         </c:if>
         <td>
         <table class="dealTable"  style="margin: 0 auto ; width: 100%">
            <tr  align="center" >
            	<th colspan="4">
            	           <c:choose>
            <c:when test="${list.dealCount==0 }">
				<a href="${initParam.root }common/showDealContents.do?dealNumber=${list.dealNumber}">
            	<img src="${initParam.root }upload/soldout.jpg" width="300px" height="300px"></a>
            </c:when>
            <c:otherwise>
                 <a href="${initParam.root }common/showDealContents.do?dealNumber=${list.dealNumber}">
            	<img src="${initParam.root }upload/${list.dealImage }" width="300px" height="300px"></a>
            </c:otherwise>
            </c:choose>
            	</th>
            </tr>
            <tr  align="center">
            	<td colspan="3"><a href="${initParam.root }/common/showDealContents.do?dealNumber=${list.dealNumber}">${list.dealTitle}</a></td>
	       		
            </tr>
            <tr>
            	 <td>${list.dealPrice }원</td>
				<td>${list.dealCount }개 남음</td>
				<td>마감일 : ${list.dealEndDate }</td>
			</tr>
         </table>
         </td>
      </c:forEach>
	</table>
	
	
	</c:otherwise>
</c:choose>